package com.odontosis.rel;

import com.lowagie.text.BadElementException;
import com.lowagie.text.Font;
import com.lowagie.text.Table;

public class RelatorioUtil {
	public static Font fontItem = new Font(Font.HELVETICA, 10, Font.NORMAL);
	public static Font fontTotal = new Font(Font.HELVETICA, 10, Font.BOLD);
	public static Font fonteTitulo = new Font(Font.HELVETICA, 11, Font.BOLD);
	public static Font fonteCabecalho = new Font(Font.HELVETICA, 13, Font.BOLD);
	public static Font fonteCabecalhoNormal = new Font(Font.HELVETICA, 13, Font.NORMAL);
	public static Font fonteRodape = new Font(Font.HELVETICA, 10, Font.NORMAL);
	
	
	public static Table criarObjetoTabela(int numColunas, float[] headerWidths) {
        try {
            Table aTable = new Table(numColunas);

            aTable.setPadding(1);
            aTable.setSpacing(0);

            aTable.setWidths(headerWidths);

            aTable.widthPercentage();
            aTable.setWidth(100);
            aTable.setBorder(0);

            aTable.setSpaceBetweenCells(0);

            aTable.setDefaultCellBorderWidth(0);
            aTable.setBorder(0);

            return aTable;
        } catch (BadElementException e) {
            throw new RuntimeException("Erro definindo largura do cabeçalho", e);
        }
    }
}
